package src;


import java.util.Random;
public class IntNumber {         //四则运算
    private int A;
    public IntNumber(int A){
        this.A = A;
    }

    public String add(IntNumber op1){
        int result = A + op1.A;
        String aaa = A + " + " + op1.A + "=";
        System.out.print(A + " + " + op1.A + "=");
        return aaa;

    }//计算

    public String subtract(IntNumber op1){
        int result = A - op1.A;
        String aaa = A + " - " + op1.A + "=";
        System.out.print(A + " - " + op1.A + "=");
        return aaa;
    }

    public String multiply(IntNumber op1){
        int result = A * op1.A;
        String aaa = A + " * " + op1.A + "=";
        System.out.print(A + " * " + op1.A + "=");
        return aaa;
    }


    public String divide(Fraction op1){
        String aaa = op1.getNumerator() + " / " + op1.getDenominator() + "=";
        System.out.print(op1.getNumerator() + " / " + op1.getDenominator() + "=");
        return op1.toString();
    }
    public int jia(IntNumber op1){
        int result = A + op1.A;

        return result;

    }

    public int jian(IntNumber op1){
        int result = A - op1.A;

        return result;
    }

    public int chen(IntNumber op1){
        int result = A * op1.A;

        return result;
    }


    public static IntNumber obj(){
        Random ran = new Random();
        return new IntNumber(ran.nextInt(100));
    }
}
